import CommonText from "../components/commonText";
import {useRef} from "react";

const Expenses = () => {
    const childrenRef = useRef(null);
    const handleClick=()=>{
        //current指向已经挂载到DOM上的元素
        childrenRef.current.getData();
    }
    return (
        <main style={{padding: "1rem 0"}}>
            <CommonText ref={childrenRef}/>
            <h2 onClick={handleClick}>
                泥嚎，我是小陈的第二个页面
            </h2>
        </main>
    )
}
export default Expenses;
